/*
 * Copyright 2007 Tiberiumlabs
 *
 * This file is part of Java Metalink.
 *
 * Java Metalink is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Java Metalink is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.metalink.content;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author <a href="mailto:paranoid.tiberiumlabs@gmail.com">Paranoid</a>
 */
public class Pieces {

    private final String  type;
    private final int length;
    private final List<String> piecesList;

    public Pieces(String type, int length) {
        this.type = type;
        this.length = length;
        this.piecesList = new ArrayList<String>(length);
    }

    public int getLength() {
        return length;
    }

    public void addHash(String hash) {
        piecesList.add(hash);
    }

    public String getHash(int index) {
        return piecesList.get(index);
    }

    public String getType() {
        return type;
    }

    public List<? extends String> getPiecesList() {
        return piecesList;
    }

}
